#   导入redis的配置
from redis import StrictRedis
class Config:
    DEBUG = None
    # 设置密钥
    SECRET_KEY = 'QI+e6HLJgDmJDz6Il95caY1FktWCDeDUrDqOrKAzk6ff3H3+KLGBRg=='
    #设置数据库的链接和动态追踪
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/new_path_news'
    SQLALCHEMY_TRACK_MODIFICATION = False

    #   定义redis的主机和port
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    #   配合状态保持存储的session信息
    SESSION_TYPE = 'redis'
    #   配置session的签名
    SESSION_USE_SIGNER = True
    #   构造redis实例
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port = REDIS_PORT)
    #   配置session过期时间
    PERMANENT_SESSION_LIFETIME = 86400


class developmentConfig(Config):
    DEBUG = True


class productionConfig(Config):
    DEBUG = False


config = {
    'development' : developmentConfig,
    'production' : productionConfig
}